import request from "@/utils/request";

export function version() {
  return request({
    url: "/version",
    method: "get",
  });
}

export const createRequest = function (base) {
  return {
    get: function (uri, data) {
      return request({
        method: "get",
        url: base + uri,
        params: data,
      });
    },
    post: function (uri, data) {
      return request({
        method: "post",
        url: base + uri,
        data,
      });
    },
    put: function (uri, data) {
      return request({
        method: "put",
        url: base + uri,
        data,
      });
    },
    remove: function (uri, data) {
      return request({
        method: "delete",
        url: base + uri,
        params: data,
      });
    },
  };
};

export default {
  createRequest,
  version,
};
